﻿using Prism.DryIoc;
using Prism.Ioc;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using wms_wpf.Apiservice;
using wms_wpf.DialogView;
using wms_wpf.DialogViewModel;
using wms_wpf.ViewModels;
using wms_wpf.Views;

namespace wms_wpf
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MainWindow, MainWindowModel>();//注册view和viewmodel
            containerRegistry.RegisterForNavigation<HouseConfigView, HouseConfigViewModel>("HouseConfigView");
            containerRegistry.RegisterForNavigation<MaterialView, MaterialViewModel>("MaterialView");
            containerRegistry.RegisterForNavigation<BoxConfigView, BoxConfigViewModel>("BoxConfigView");
            containerRegistry.RegisterForNavigation<Dialog1, Dialog1ViewModel>("Dialog1");
            containerRegistry.RegisterForNavigation<Dialog2, Dialog2ViewModel>("Dialog2");
            containerRegistry.RegisterForNavigation<Dialog3, BoxConfigViewModel>("Dialog3");
            containerRegistry.RegisterScoped<IBaseService, BaseService>();
            containerRegistry.RegisterScoped<IViewService, ViewService>();

        }
    }
}
